//
//  GXIdentityExchangeView.m
//  YIChuSeller
//
//  Created by 田小椿 on 2018/11/30.
//  Copyright © 2018年 xiangshengjun. All rights reserved.
//

#import "GXIdentityExchangeView.h"
@interface GXIdentityExchangeView ()
@property (weak, nonatomic) IBOutlet UIView *leftLine;
@property (weak, nonatomic) IBOutlet UIView *rightLine;
@property (weak, nonatomic) IBOutlet UIButton *personBtn;
@property (weak, nonatomic) IBOutlet UIButton *sellerBtn;

@end
@implementation GXIdentityExchangeView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)awakeFromNib {
    [super awakeFromNib];
    self.personBtn.titleLabel.textColor = RGBColor(120, 120, 120);
    self.sellerBtn.titleLabel.textColor = RGBColor(184, 184, 184);
    self.rightLine.hidden = YES;
    self.leftLine.hidden = NO;
}
+(instancetype)exchangeView
{
    return [[NSBundle mainBundle]loadNibNamed:@"GXIdentityExchangeView" owner:nil options:nil].lastObject;
}
- (IBAction)clickExchangeBtn:(UIButton *)sender {
    if ([sender.titleLabel.text isEqualToString:@"个人"]) {
        self.personBtn.titleLabel.textColor = RGBColor(120, 120, 120);
        self.sellerBtn.titleLabel.textColor = RGBColor(184, 184, 184);
        self.rightLine.hidden = YES;
        self.leftLine.hidden = NO;
    } else if([sender.titleLabel.text isEqualToString:@"商家"]) {
        self.rightLine.hidden = NO;
        self.leftLine.hidden = YES;
        self.sellerBtn.titleLabel.textColor = RGBColor(120, 120, 120);
        self.personBtn.titleLabel.textColor = RGBColor(184, 184, 184);
    }
    if ([self.delegate respondsToSelector:@selector(clickExchangeButton:)]) {
        [self.delegate clickExchangeButton:sender];
    }
}

@end
